package com.tree;

public class RevertTree {

	
	public TreeNode revert(TreeNode root){
		if (root == null){
			return null;
		}
		
		root.left = this.revert(root.left);
		root.right = this.revert(root.right);
		
		TreeNode tmp = root.left;
		root.left = root.right;
		root.right = tmp;
		
		return root;
	}
	
}
